<form id="form_memdays_showedit" method="post" action="y.php?r=memdays/savedata">
    <input type="hidden" name="memdays_id" value="">
    <div style="margin-bottom:20px">
        <input class="easyui-textbox" name="title" style="width:100%" data-options="label:'主题:',required:true">
    </div>
    <div style="margin-bottom:20px">
        <input class="easyui-textbox" name="customer" style="width:100%"
               data-options="label:'客户:'">
    </div>
    <div style="margin-bottom:20px">
        <select class="easyui-combobox" name="memdays_type" label="联系类型" style="width:100%">
            <option value="无">无</option>
            <option value="生日">生日</option>
            <option value="子女生日">子女生日</option>
            <option value="父母生日">父母生日</option>
            <option value="结婚纪念日">结婚纪念日</option>
            <option value="公司成立纪念日">公司成立纪念日</option>
            <option value="毕业纪念日">毕业纪念日</option>
            <option value="其他">其他</option>
        </select>
    </div>
    <div style="margin-bottom:20px">
        <select class="easyui-combobox" name="calendar_type" label="日历类型" style="width:100%">
            <option value="公历">公历</option>
            <option value="阴历">阴历</option>
        </select>
    </div>
    <div style="margin-bottom:20px">
        <input class="easyui-datebox" name="memdays_day" style="width:100%"
               data-options="label:'纪念日:'">
    </div>
</form>
<div style="text-align:center;padding:5px 0">
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:80px">保存</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:80px">清空</a>
</div>
<script>
    var dataobj = <?php echo json_encode($memdays) ?>;
    $(function () {
        $('#form_memdays_showedit').form('load', dataobj);
    });
    function submitForm() {
        $('#form_memdays_showedit').form('submit', {
            success: function () {
                $('#win_main').window("close");
                $("#memdays_list").datagrid("reload");
            }
        });
    }
    function clearForm() {
        $('#form_memdays_showedit').form('clear');
        if (dataobj != null) {
            $("input[name=memdays_id]").val(dataobj.memdays_id);
        }
    }
</script>